/**
 * 
 */
package com.qdairlines.controller.dict;

import com.qdairlines.constant.RequestConsts;
import com.qdairlines.entity.user.User;
import com.qdairlines.service.dict.MasterDataService;
import com.qdairlines.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author pangyannan
 * @date 2017年8月22日
 * @company QingDao Airlines
 * @description
 */
@Controller
@RequestMapping("masterData")
public class MasterDataController {
	@Autowired
	private MasterDataService masterDataService;
	@Autowired
	private UserService userService;
	
	/**
	 * http://172.16.12.83:8080/BaseWeb/masterData/test.do
	 * @return
	 */
	@RequestMapping(value = "test",produces =RequestConsts.PRODUCES)
	@ResponseBody
	public String test(){
		List<User> userList =  userService.listData(new User());
		masterDataService.convert(userList, "id", "workcode", "ALL_USER");
		masterDataService.convertFromDictCode(userList, "id", "workcode", "T_USER_STATUS");
		String json = masterDataService.getMultiselectDataByMasterDataList("ALL_USER",1);
		//return ControllerUtil.getJson(userList);
		return json;
	}

}
